package com.cn.why.springclouduser_server.service.Impl;

import com.cn.why.springclouduser_server.service.UserService;
import com.cn.why.springclouduser_server.entity.User;
import com.cn.why.springclouduser_server.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 业务实现类
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;
    /**
     * 判断登录
     * @param user
     * @return
     */
    @Override
    public boolean login(User user) {
        if(userMapper.login(user)!=null){
            return true;
        }
        return false;
    }

    /**
     * 返回的user
     */
    public User getUser(User user){
       return userMapper.login(user);
    }
}
